#include <cstdio>
const int maxn = 1000010, mod = 1000000007;
int n, l, r = 1, f[maxn], c[maxn], p[maxn];
inline void add(int &x, const int &y)
{
    if ((x += y) >= mod) x -= mod;
}
inline void init(){
    for (int i = 2 ; i <= maxn - 10; ++i)
    {
        if (!c[i]) p[++l] = i, c[i] = i;
        for (int j = 1 ; j <= l && p[j] * i <= maxn - 10; ++j)
        {
            c[i * p[j]] = p[j];
            if (i % p[j] == 0) break;
        }
    }
}
inline void cal(){
    scanf("%d", &n);
    r = f[0] = f[1] = 1;
    for (int i = 2 ; i <= n ; ++i)
    {
        f[i] = f[i - 1] + f[i - 2];
        if (f[i] >= mod) f[i] -= mod;
    }
    for (int i = 1 ; i <= n ; ++i) p[i] = 0;
    for (int i = n ; i >= 2 ; --i)
    {
        add(p[c[i]], f[n - i]);
        add(f[n - i / c[i]], f[n - i]);
        if (i == c[i]) r = (long long)r * (p[i] + 1) % mod;
    }
    printf("%d\n", r);
}
int main()
{
    init();
    int T;
    scanf("%d",&T);
    while(T--){
        cal();
    }
    return 0;
}